package com.sumer.function;

import java.util.function.Supplier;

/**
 * 没有参数  只有返回值
 */
public class SupplierTest {

    public static void main(String[] args) {
        Supplier<String> supplier1 = new Supplier<String>() {
            @Override
            public String get() {
                return "hello";
            }
        };

        //简写
        Supplier<String> supplier2 = () -> "Hello";

        System.out.println(supplier1.get());
        System.out.println(supplier2.get());
    }
}
